home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_010 / iff / packer.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  40 lines

  1. #ifndef PACKER_H
  2. #define PACKER_H
  3. /*----------------------------------------------------------------------*
  4.  * PACKER.H  typedefs for Data-Compresser.                     11/15/85
  5.  *
  6.  * This module implements the run compression algorithm "cmpByteRun1"; the
  7.  * same encoding generated by Mac's PackBits.
  8.  *
  9.  * By Jerry Morrison and Steve Shaw, Electronic Arts.
  10.  * This software is in the public domain.
  11.  *
  12.  * This version for the Commodore-Amiga computer.
  13.  *----------------------------------------------------------------------*/
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. /* This macro computes the worst case packed size of a "row" of bytes. */
  20. #define MaxPackedSize(rowSize)  ( (rowSize) + ( ((rowSize)+127) >> 7 ) )
  21.  
  22.  
  23. /* Given POINTERS to POINTER variables, packs one row, updating the source
  24.  * and destination pointers. Returns the size in bytes of the packed row.
  25.  * ASSUMES destination buffer is large enough for the packed row.
  26.  * See MaxPackedSize. */
  27. extern LONG PackRow(/* BYTE **, BYTE **, LONG */);
  28.                    /*  pSource, pDest,   rowSize */
  29.  
  30. /* Given POINTERS to POINTER variables, unpacks one row, updating the source
  31.  * and destination pointers until it produces dstBytes bytes (i.e., the
  32.  * rowSize that went into PackRow).
  33.  * If it would exceed the source's limit srcBytes or if a run would overrun
  34.  * the destination buffer size dstBytes, it stops and returns TRUE.
  35.  * Otherwise, it returns FALSE (no error). */
  36. extern BOOL UnPackRow(/* BYTE **, BYTE **, WORD,     WORD */);
  37.                      /*  pSource, pDest,   srcBytes, dstBytes  */
  38.  
  39. #endif
  40.